{include file="public/header" /}


<!-- 服务单审核 -->


<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.ds_service_order}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.ds_order_sn}</dt>
                <dd><input type="text" class="text w150" name="order_sn" value="{$Request.param.order_sn}"></dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_state}</dt>
                <dd>
                    <select name="order_state" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="0" {if condition="$Request.param.order_state eq '0'"}selected{/if}>已作废</option>
                        <option value="1" {if condition="$Request.param.order_state eq '1'"}selected{/if}>待审核</option>
                        <option value="6" {if condition="$Request.param.order_state eq '6'"}selected{/if}>审核未通过</option>
                        <option value="2" {if condition="$Request.param.order_state eq '2'"}selected{/if}>待支付</option>
                        <option value="3" {if condition="$Request.param.order_state eq '3'"}selected{/if}>支付完成待派单</option>
                        <option value="9" {if condition="$Request.param.order_state eq '9'"}selected{/if}>派单中</option>
                        <option value="7" {if condition="$Request.param.order_state eq '7'"}selected{/if}>疑问单</option>
                        <option value="8" {if condition="$Request.param.order_state eq '8'"}selected{/if}>已接单</option>
                        <option value="4" {if condition="$Request.param.order_state eq '4'"}selected{/if}>已完成</option>
                        <option value="5" {if condition="$Request.param.order_state eq '5'"}selected{/if}>已退款</option>
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>订单类型</dt>
                <dd>
                    <select name="order_type" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="1" {if condition="$Request.param.order_type eq '1'"}selected{/if}>安装</option>
                        <option value="2" {if condition="$Request.param.order_type eq '2'"}selected{/if}>维修</option>
                        <option value="3" {if condition="$Request.param.order_type eq '3'"}selected{/if}>移机</option>
                        <option value="4" {if condition="$Request.param.order_type eq '4'"}selected{/if}>保养</option>
                        
                    </select>
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_time_from}</dt>
                <dd>
                    <input type="text" class="txt date" name="query_start_time" id="query_start_time" value="{$Request.param.query_start_time}">
                        &nbsp;–&nbsp;
                        <input id="query_end_time" class="txt date" type="text" name="query_end_time" value="{$Request.param.query_end_time}">
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.ds_buyer_name}</dt>
                <dd>
                    <input type="text" class="text w80" name="buyer_name" value="{$Request.param.buyer_name}">
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.operator}</dt>
                <dd>
                    <input type="text" class="text w80" name="invite_store_name" value="{$Request.param.invite_store_name}">
                </dd>
            </dl>
            <div class="btn_group">
                <input type="submit" class="btn" value="{$Think.lang.ds_search}" style="display: inline-block;">
                {if $filtered}
                <a href="{:url('Service/index')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                {/if}
            </div>
        </div>    
    </form>

    <table class="ds-default-table">
        <thead>
            <tr>
                <th>{$Think.lang.ds_order_sn}</th>
                <th>订单来源</th>
                <th>{$Think.lang.ds_order_type}</th>
                <th>{$Think.lang.ds_buyer_name}</th>
                <th>{$Think.lang.operator}</th>
                <th>{$Think.lang.order_total_price}</th>
                <th>{$Think.lang.order_state}</th>
                <th>{$Think.lang.order_time}</th>
                <th>{$Think.lang.ds_handle}</th>
            </tr>
        </thead>
        {empty  name="order_list"}
        <tbody>
            <tr class="no_data">
                <td colspan="20">{$Think.lang.no_record}</td>
            </tr>
        </tbody>
        {else /}
        <tbody>
            {foreach name="order_list" item="order"}
            <tr>
                <td>{$order.order_sn}</td>
                <td>{$order_source[$order.order_source]}</td>
                <td>{$order_type[$order.order_type]}</td>
                <td>{$order.member_name}</td>
                <td>{$order.invite_store_name ? $order.invite_store_name : '暂无'}</td>
                <td>{$order.order_amount}</td>
                <td>{$order_state[$order['order_state']]}</td>
                <td>{$order.add_time|date="Y-m-d H:i:s",###}</td>
                <td class="w15 align-center">
                    <a href="javascript:dsLayerOpen('{:url('Service/service_edit',['service_id'=>$order.order_id])}','编辑{$order.order_sn}')" class="dsui-btn-edit"><i class="iconfont"></i>编辑</a>
                    <?php if($order['order_state']==1){ ?>
                    <a href="{:url('Service/examine',['order_id'=>$order.order_id])}" class="dsui-btn-edit"><i class="iconfont"></i>审核</a>
                    <?php } ?>
                    <?php if($order['order_state']!=0){ ?>
                        <a href="javascript:dsLayerConfirm('{:url('Service/del_order',['order_id'=>$order.order_id])}','您确定要作废该订单吗？')" class="dsui-btn-del"><i class="iconfont"></i>作废</a>
                    <?php } ?>

                    <?php if(!in_array($order['order_state'],[4,5,0])){ ?>
                    <!-- <a href="javascript:dsLayerOpen('{:url('Service/append',['service_id'=>$order.order_id])}','追加服务费用{$order.order_sn}')" class="dsui-btn-view"><i class="iconfont"></i>+服务费</a> -->

                    <a href="{:url('Service/show_equipments',['service_id'=>$order.order_id,'order_form'=>1])}" class="dsui-btn-edit"><i class="iconfont"></i>+设备</a>
                    <?php } ?>

                    <!-- 商品单是在接单以后显示 -->
                    <?php if($order['service_state']==1){ ?>
                    <a href="javascript:dsLayerOpen('{:url('Service/send',['order_id'=>$order.order_id])}','商品单{$Think.lang.ds_service_order}-{$order.order_sn}')" class="dsui-btn-edit"><i class="iconfont"></i>商品单</a>
                    <?php } ?>
                </td>
            </tr>
            {/foreach}
        </tbody>
        {/empty}
    </table>
    {$show_page}
</div>

<script type="text/javascript">
$(function(){
    $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
    $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
});
</script> 

